<template>
	<view>
		<view class="">
			{{info.username}}
		</view>
		<view class="">
			{{info.title}}
		</view>
		<view class="">
			{{info.content}}
		</view>
	</view>
</template>

<script setup>
	import { onLoad } from '@dcloudio/uni-app'
	
	onLoad((event) => {
		console.log('加载信息: ', event)
		bid.value = event.bid
		query()
	})
	
	import {
		ref
	} from 'vue'
	import {
		api,
		tools
	} from '../../api/api.js'
	
	const bid = ref(-1)
	
	const info = ref({})
	
	const query = () => {
		api.get(`/crud/billboard/${bid.value}`, {}, (data) => {
			if(data.success) {
				info.value = data.data
				return
			}
			uni.showToast({
				title: data.message,
				complete: () => {
				    uni.navigateTo({
				    	url: '/pages/notice/notice'
				    })	
				}
			})
		})
	}
	
</script>

<style>

</style>
